//
// This script is executed by Grails during application upgrade ('grails upgrade'
// command). This script is a Gant script so you can use all special variables
// provided by Gant (such as 'baseDir' which points on project base dir). You can
// use 'ant' to access a global instance of AntBuilder
//
// For example you can create directory under project tree:
//
//    ant.mkdir(dir:"${basedir}/grails-app/jobs")
// 

Ant.property(environment:"env")
grailsHome = Ant.antProject.properties."env.GRAILS_HOME"

includeTargets << new File ( "${grailsHome}/scripts/_GrailsInit.groovy" )
checkVersion()


Ant.sequential {

    event("StatusUpdate", ["Installing Glossy Template"])

    mkdir(dir:"${basedir}/src/templates/")
    mkdir(dir:"${basedir}/src/templates/artifacts")
    mkdir(dir:"${basedir}/src/templates/scaffolding")
    copy(todir:"${basedir}/src/templates/") {
      fileset(dir:"${pluginBasedir}/src/templates/") {
      }
    }

    copy(todir:"${basedir}/grails-app/i18n/") {
      fileset(dir:"${pluginBasedir}/grails-app/i18n/") {
      }
    }
}

event("StatusFinal", ["Updating Glossy Template"])